Skip to content

fix(wsl): fall back from a failed connect snapshot, and hint only from its own record read - #35663

Merged
nwparker merged 1 commit into
mainfrom
nwparker/wsl-connect-state-followup
Oct 29, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/wsl-connect-state-followup

Conversation

@nwparker

@nwparker nwparker commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​40 $\color{#cf222e}{\Huge{\mathbf{−}}}$​8 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​32
Prod 1 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6

ELI5

This is a follow-up to #35591, which reads a WSL connect's state in one command and uses the answers as hints. Reviewers asked for four tightenings. If that one command fails, the connect now falls back to the old separate reads instead of failing. If the command couldn't read the activation record itself, no hints are used.

What Changed

  • Fallback on failure. Before, a snapshot command that failed (a transport error or a lock-guard refusal) made the whole connect fail. Now the connect runs the per-file reads exactly as before perf(wsl): read a connect's pre-fence activation state in one command #35591. A cancelled connect still stops, because those reads use the same abort signal.
  • No hints from a fallback read. Before, a snapshot whose record section was unreadable could still hand out hints if the fallback record read then succeeded. Now the reader exposes no snapshot in that case, so recovery, adoption and deploy all read the host.
  • Comment. A one-line comment notes that $(cat) drops trailing newlines, so snapshot contents aren't byte-exact. Every consumer parses them as JSON.
  • Connect-level tests. These now pin a held fence (the deploy re-probes it) and a pending journal (recovery reads the host), alongside the idle case.

Why

These are review items on #35591 from d1c-review-low and d3-gate-audit. The snapshot is an optimisation, so any failure of it should cost only the reads it replaced, never the connect. A hint should only come from a read the snapshot itself answered.

Flag-off: the WSL host path only runs with ORCA_INTERNAL_WSL_HOSTS set; with it unset nothing here runs. SSH is untouched.
User-risk: very low. Every change makes the snapshot fall back to the pre-#35591 reads in more cases.

Linked Issue

N/A (follow-up to #35591).

Visual Proof

N/A: no UI.

Testing

  • wsl-orcad-connect-state-snapshot.test.ts:

    • a rejected snapshot command falls back to the plain read and gives no hints;
    • an unreadable record section gives no hints even when the fallback read succeeds;
    • an oversized record still fails closed.
  • wsl-orcad-deploy.test.ts: covers three cases — nothing pending, a held fence, a pending journal — passed through to recovery and deploy.

  • wsl-orcad-held-context.test.ts passes. pnpm tc, pnpm run typecheck:ci, the changed-code quality gate, anti-slop oxlint and oxlint all pass.

  • I manually tested these changes locally

  • Automated tests added/updated, or explained why not below

Review

Agent skill upstream boundary

  • Not applicable, or this change copies or mechanically translates no upstream skill-installer source, tests, fixtures, registry entries, path tables, comments, or documentation.

Notes

No SSH, wire or security change beyond failing back to the earlier reads.

Checklist

  • This PR is small and focused
  • I explained what changed and why (ELI5, the user-facing before/after, the mechanism, and why over the alternatives)
  • Before/after screenshots or videos attached for UI changes, or N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform, SSH/remote, and path/shortcut impact considered (or N/A)
  • pnpm lint, pnpm typecheck, pnpm test, and pnpm build pass (or CI will cover; local preferred)

…m its own record read

A snapshot command that rejects now falls back to the per-file reads
instead of failing the connect. A snapshot whose record section was
unreadable gives no hints even when the fallback read answered. Pins the
held-fence and pending-journal cases at the connect level, and notes that
snapshot raws drop trailing newlines.
@coderabbitai

coderabbitai Bot commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 7 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 32ff9f23-93c3-401b-94b1-efc7fe1963f7
Commits

Reviewing files that changed from the base of the PR and between d334119 and dffcc55.

Files selected for processing: 3
  • src/main/wsl/wsl-orcad-connect-state-snapshot.test.ts
  • src/main/wsl/wsl-orcad-connect-state-snapshot.ts
  • src/main/wsl/wsl-orcad-deploy.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Oct 29, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] This PR appears safe to merge.

Summary

This PR makes the WSL connect snapshot optional when its command fails.

  • WSL connects continue after a failed state snapshot.
  • WSL connects use no snapshot hints when the activation record is unreadable.

No actionable issues were found. Review checks used source and test inspection; tests were not run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Read connect snapshot] --> B{Command and record readable?}
  B -->|Yes| C[Return record and snapshot hints]
  B -->|No| D[Read activation record separately]
  D --> E{Read succeeds?}
  E -->|Yes| F[Continue without snapshot hints]
  E -->|No or cancelled| G[Stop connect]
Loading

Reviews (1) · Last reviewed commit: "fix(wsl): fall back from a failed connec..." · Reviewed by Greptile

@nwparker
nwparker merged commit dd29fc7 into main Oct 29, 2026
51 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant